<template>
    <div class="compare">
        <div class="item" v-for="item in compareList" :key="item.title">
            <img :src="item.src" alt="">
            <h3>{{item.title}}</h3>
            <p>{{item.price}}</p>
            <p>{{item.year}}</p>
            <p>{{item.alcohol}}</p>
            <p>{{item.region}}</p>
            <p>{{item.varietal}}</p>
        </div>
        <div class="close" @click="$emit('close')">x</div>
    </div>
  
</template>

<script>
export default {
    props:['compareList']
}
</script>

<style lang="scss" scoped>
.compare {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #242529;
  display: flex;
}
.close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 30px;
  color: #cecece;
  cursor: pointer;
}
.item {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #cecece;
  &:nth-child(odd) {
    background: #212226;
  }
  h3 {
    margin: 12px 0;
  }
  p {
    margin-bottom: 12px;
  }
}
</style>